import {customeStruct} from '../utils';
const itf = customeStruct.interface;

export const InitDataStruct = itf({
    payload: itf({
        brands: [itf(Object.assign({
            id: 'string',
            code: 'string',
            name: 'string',
        }))],
        isDealerUser: 'boolean',
    })
});

const content = {
    id: 'string',
    code: 'string',
    rowVersion: 'string',
    options: ['string']
};

export const List = itf({
    payload: itf({
        content: [itf(Object.assign(content))]
    })
});

export const Detail = itf({
    payload: itf({
        id: 'string',
        code: 'string',
        rowVersion: 'string',
        options: ['string'],
        details: [
            itf({
                piCode: 'string? | null',
            })
        ]
    })
});

const dealer = {
    id: 'string',
    code: 'string',
    name: 'string'
};

export const DealerList = itf({
    payload: itf({
        content: [itf(dealer)]
    })
});

export const DealerSimpleList = itf({
    payload: itf({
        content: [
            itf({
                id: 'string',
                code: 'string',
                name: 'string'
            })
        ]
    })
});
